package spec.maxiuying.unit3.task3_3;

public class FinanceInfo2 {
    private static String companyName;

    private static double earnestIncome;

    private static double depositIncome;

    private static double rentIncome;

    private static double otherIncome;

    private static double staffCost;

    private static double rentCost;

    private static double hydropowerCost;

    private static double taxCost;

    private static double otherCost;

    //无参数的构造方法

    public FinanceInfo2(){

        System.out.println("使用无参数构造方法创建财务信息对象！");

    }

    //有参数的构造方法

    public FinanceInfo2(String companyName,double earnestIncome,double depositIncome,

                        double rentIncome,double otherIncome,double staffCost,double

                                rentCost,double hydropowerCost,double taxCost,double otherCost){

        super();

        System.out.println("使用带参数的构造方法创建财务信息类对象");

        this.companyName=companyName;

        this.earnestIncome=earnestIncome;

        this.depositIncome=depositIncome;

        this.rentIncome=rentIncome;

        this.otherIncome=otherIncome;

        this.staffCost=staffCost;

        this.rentCost=rentCost;

        this.hydropowerCost=hydropowerCost;

        this.taxCost=taxCost;

        this.otherCost=otherCost;

    }

    //一组set/get属性方法

    public String getCompanyName() {

        return companyName;

    }

    public void setCompanyName(String companyName){

        this.companyName=companyName;

    }



    public double getEarnestIncome() {

        return earnestIncome;

    }

    public void setEarnestIncome(double earnestIncome){

        this.earnestIncome=earnestIncome;

    }



    public double getDepositIncome() {

        return depositIncome;

    }

    public void setDepositIncome(double depositIncome){

        this.depositIncome=depositIncome;

    }



    public double getRentIncome() {

        return rentIncome;

    }

    public void setRentIncome(double rentIncome){

        this.rentIncome=rentIncome;

    }



    public double getOtherIncome() {

        return otherIncome;

    }

    public void setOtherIncome(double otherIncome){this.otherIncome=otherIncome;}



    public double getStaffCost() {

        return staffCost;

    }

    public void  setStaffCost(double staffCost){

        this.staffCost=staffCost;

    }



    public double getRentCost() {

        return rentCost;

    }

    public void setRentCost(double rentCost){

        this.rentCost=rentCost;

    }



    public double getHydropowerCost() {

        return hydropowerCost;

    }

    public void setHydropowerCost(double hydropowerCost){

        this.hydropowerCost=hydropowerCost;

    }



    public double getTaxCost() {

        return taxCost;

    }

    public void setTaxCost(double taxCost){

        this.taxCost=taxCost;

    }



    public double getOterCost() {

        return otherCost;

    }

    public void setOterCost(double oterCost){

        this.otherCost=oterCost;

    }

    //收入计算

    public double calIncome(){

        double sumIncome=earnestIncome+depositIncome+rentIncome+otherIncome;

        return sumIncome;

    }

    //成本计算

    public  double calCost(){

        double sumCost=staffCost+rentCost+hydropowerCost+taxCost+otherCost;

        return sumCost;

    }

    //净收入计算

    public double calNetIncome(){

        System.out.println(companyName+"的净收入计算方法");

        double netIncome=calIncome()-calCost();

        return netIncome;

    }

}



